package cn.south.campus.business.controller;

import cn.south.campus.business.model.vo.MyPageVo;
import cn.south.campus.business.model.vo.UserVo;
import cn.south.campus.business.service.UserService;
import cn.south.campus.common.model.bo.Result;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author chow
 * @since 2024-11-13
 */
@RestController
@RequestMapping("/campus/user")
@AllArgsConstructor
public class UserController {

    private final UserService userService;

    @PutMapping("modify")
    public Result<String> modify(@RequestBody UserVo userVo) {
        userService.modify(userVo);
        return Result.success("修改成功");
    }

    @GetMapping("my")
    public Result<MyPageVo> my(){
        return Result.success(userService.info());
    }
}
